#!/bin/sh

# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

network_enabled() {
    return 0
}

network_run() {
    if [ -n "$bootparam_ip" ]; then
        load_kernel_module r8169
        load_kernel_module igc
        if [ "${bootparam_ip}" -ne "dhcp" ]; then
            echo "WARN: DHCP only supported at this time."
        fi
        ethernetifname=$(ls /sys/class/net|grep -E 'en|eth')
        ip link set dev ${ethernetifname} up
        udhcpc -i ${ethernetifname}
    fi
}


